package com.example.testdemo.spring.config;

import com.example.testdemo.annotation.Component;
import com.example.testdemo.expection.BeansException;
import com.example.testdemo.spring.factory.SingletonBeanFactory;

import java.util.Set;

/**
 * <p>
 *
 * </p>
 *
 * @author 永健
 * @since 2020-03-29 03:12
 */
@Component
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor{

    @Override
    public void postProcessBeanFactory(SingletonBeanFactory beanFactory) throws BeansException {
        Set<String> names = beanFactory.getBeanDefinitionNames();
        System.out.println("共有Bean:"+beanFactory.getBeanDefinitionCount());
    }
}
